package com.example.layui.mapper;

import com.example.layui.pojo.Menu;
import com.example.layui.pojo.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RoleMapper {
    public List<Role> queryAllRole();

    Integer count(Role role);

    List<Role> queryByPage(@Param("role") Role role,@Param("from") int from,@Param("size") Integer size);

    int addRole(Role role);

    Role queryRoleById(int id);

    int updateRole(Role role);

    int delUserRole(Integer rid);

    int delRoleMenu(Integer rid);

    int delRole(Integer rid);

    List<Menu> getMenusByRoleId(@Param("rid") Integer rid);

    int addMenu(@Param("rid") Integer rid,@Param("mid") Integer mid);

    int delMenu(@Param("rid") Integer rid,@Param("mid") Integer mid);
}
